package com.project.exception;

import com.project.common.result.ResultCodeEnum;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

@Data
@NoArgsConstructor
@AllArgsConstructor
@ToString
public class MyException extends RuntimeException{
    private Integer code;//状态码
    private String msg;//描述信息

    /**
     * 接受枚举类型对象
     * @param resultCodeEnum
     */
    public MyException(ResultCodeEnum resultCodeEnum){
        this.code=resultCodeEnum.getCode();
        this.msg=resultCodeEnum.getMessage();

    }
}
